#唐门优测
#道长最帅666
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

"获取验证信息"

#实例化浏览器驱动
driver = webdriver.Chrome()
driver.maximize_window()
driver.get('http://www.baidu.com')

#标题
print(driver.title)
#获取属性值
id = driver.find_element_by_id('kw')
print(id.get_attribute('name'))
#获取文本信息
xinwen = driver.find_element_by_xpath('//*[@id="s-top-left"]/a[3]')
print(xinwen.text)